CREATE TABLE [dbo].[TMPRES_SERV]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_PROV] [dbo].[TD_VC_020] NOT NULL,
[CO_NACI] [dbo].[TD_VC_008] NULL,
[CO_CONV] [dbo].[TD_VC_003] NULL,
[NU_RUCC_CUAR] [dbo].[TD_VC_020] NULL,
[CO_VIAS] [dbo].[TD_VC_003] NULL,
[FE_NACI] [dbo].[TD_DT_001] NULL,
[ST_SEXO] [dbo].[TD_VC_001] NULL,
[CO_UBIC_PANA] [dbo].[TD_VC_006] NULL,
[ST_DISC] [dbo].[TD_VC_001] NULL,
[ST_COND_DOMI] [dbo].[TD_VC_001] NULL,
[FE_BAJA_PRES] [dbo].[TD_DT_001] NULL,
[NU_VIAS] [dbo].[TD_VC_006] NULL,
[NO_VIAS] [dbo].[TD_VC_020] NULL,
[NU_INTE] [dbo].[TD_VC_006] NULL,
[CO_ZONA] [dbo].[TD_VC_003] NULL,
[NO_ZONA] [dbo].[TD_VC_020] NULL,
[DE_REFE] [dbo].[TD_VC_100] NULL,
[CO_UBIC_GEOG] [dbo].[TD_VC_006] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMPRES_SE__FE_US__6501FCD8] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL,
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMPRES_SE__FE_US__65F62111] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [XPKTMPRES_SERV] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_PROV]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [PK1_TTCOEV_DOTR_A_TMPRES_SERV] FOREIGN KEY ([CO_CONV]) REFERENCES [dbo].[TTCOEV_DOTR] ([CO_CONV])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [PK1_TTNACI_A_TMPRES_SERV] FOREIGN KEY ([CO_NACI]) REFERENCES [dbo].[TTNACI] ([CO_NACI])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [PK1_TTVIAS_A_TMPRES_SERV] FOREIGN KEY ([CO_VIAS]) REFERENCES [dbo].[TTVIAS_RTPS] ([CO_VIAS])
GO
ALTER TABLE [dbo].[TMPRES_SERV] ADD CONSTRAINT [PK1_TTZONA_RTPS_A_TMPRES_SERV] FOREIGN KEY ([CO_ZONA]) REFERENCES [dbo].[TTZONA_RTPS] ([CO_ZONA])
GO
